package mlz.d_desk;

/*
    测试类
 */
public class DeskDemo {
    public static void main(String[] args) {
        Desk desk = new Desk();

        //创建3个生产者线程(厨师)
        new Thread(() -> {
            while (true){
                desk.put();
            }
        },"厨师1").start();

        new Thread(() -> {
            while(true){
                desk.put();
            }
        },"厨师2").start();

        new Thread(() -> {
            while(true){
                desk.put();
            }
        },"厨师3").start();


        //创建2个消费者线程(顾客)
        new Thread(() -> {
            while(true){
                desk.eat();
            }
        },"顾客1").start();

        new Thread(() -> {
            while(true){
                desk.eat();
            }
        },"顾客2").start();
    }
}













